package cn.uce.cc.rest.control;

import cn.uce.cc.entity.CcAgent;
import cn.uce.cc.entity.CcAgentCall;
import cn.uce.cc.srv.biz.impl.CcAgentBiz;
import cn.uce.cc.srv.biz.impl.CcAgentCallBiz;
import cn.uce.common.annontion.Operation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * Created by zhaocan on 2018/5/3.
 * 呼叫中心通话统计
 */
@Controller
@RequestMapping("/callCenter/agentcall")
public class AgentCallController {

    private Logger log = LoggerFactory.getLogger(getClass());

    @Resource
    private CcAgentBiz ccAgentBiz;

    @Resource
    private CcAgentCallBiz ccAgentCallBiz;
    /**
     * 获取近七日客服通话记录情况
     * @return 操作结果
     */
    @RequestMapping(value = "/getSevenDayInfrushStatistics")
    @ResponseBody
    public List<Map<String,Object>> getSevenDayInfrushStatistics( ) {
        CcAgentCall ccAgentCall = new CcAgentCall();
        //String userId = WebUtil.getCurrentUser().getEmpCode();
        String userId = "91";
        CcAgent ccAgent = ccAgentBiz.getCcAgentByUserId(userId);
        ccAgentCall.setAgtid("");//2018-05-03 此处需根据登陆人获取*/
        List<Map<String, Object>> list = ccAgentCallBiz.getSevenDayInfrushStatistics(ccAgentCall);
        return list;
    }

    /**
     * 获取客服当天振铃平均时长
     * @return 操作结果
     */
    @RequestMapping(value = "/getAverageRingTime")
    @ResponseBody
    public List<Map<String,Object>> getAverageRingTime(){
        CcAgentCall ccAgentCall = new CcAgentCall();
        //String userId = WebUtil.getCurrentUser().getEmpCode();
        String userId = "91";
        CcAgent ccAgent = ccAgentBiz.getCcAgentByUserId(userId);
        ccAgentCall.setAgtid("");//2018-05-03 此处需根据登陆人获取
        List<Map<String, Object>> list = ccAgentCallBiz.getAverageRingTime(ccAgentCall);
        return list;
    }


}
